home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved.
- *
- * (b) If this Sample Code is distributed as part of the Display PostScript
- * System Software Development Kit from Adobe Systems Incorporated,
- * then this copy is designated as Development Software and its use is
- * subject to the terms of the License Agreement attached to such Kit.
- *
- * (c) If this Sample Code is distributed independently, then the following
- * terms apply:
- *
- * (d) This file may be freely copied and redistributed as long as:
- * 1) Parts (a), (d), (e) and (f) continue to be included in the file,
- * 2) If the file has been modified in any way, a notice of such
- * modification is conspicuously indicated.
- *
- * (e) PostScript, Display PostScript, and Adobe are registered trademarks of
- * Adobe Systems Incorporated.
- *
- * (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
- * CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
- * AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
- * ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
- * OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
- * WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
- * WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
- * DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS.
- */
-
- /*
- * GraphicImport.h
- *
- * This subclass of handles much of the overhead for imported
- * files such as tiff files and EPS files. Subclasses of this object
- * provide the specific methods that differeniate the two.
- *
- * Version: 2.0
- * Author: Ken Fromm
- * History:
- * 03-20-91 Created the file.
- */
-
- #import <objc/Object.h>
- #import "ImportApp.h"
- #import "epsfstruct.h"
-
- #import <appkit/graphics.h>
- #import <objc/hashtable.h>
-
- #define PTS_GRAPHIC 8
- #define SIZE_MIN 16
- #define IMAGE_MAX 1500 /* Maximum size for using an NXImage */
-
- #define LEFT 0
- #define MIDDLE 1
- #define RIGHT 2
- #define TOP 0
- #define BOTTOM 2
-
- #define XPOS 18
- #define YPOS 49
-
- /*
- * The image variable holds the NXImage (the offscreen buffer
- * the file. The imagerep variable holds the NXEPSImageRepSub.
- * This class retains the original dimensions of the file as
- * an instance variable. The rotation stores the rotation of
- * the file and the bounds holds the position and dimensions
- * of the file in the document.(The dimensions are in unrotated
- * space.
- */
- @interface GraphicImport : Object
- {
- NXAtom filename; /* the name of the file */
-
- id image, /* id of the NXImage that serves as the bit cache */
- imagerep; /* id of the NXImage rep that draws the file */
-
- float rotation; /* the angle of rotation */
-
- NXRect bounds; /* the non-rotated bounding box in the document */
-
- struct _gflags {
- unsigned char new:1; /* constrained to original aspect when new */
- unsigned char selected:1; /* selected or not */
- unsigned char dirty:1; /* needs to be redrawn */
- unsigned char unimageable:1; /* cannot be imaged - (path not valid) */
- unsigned char error:1; /* error when imaging */
- unsigned char filler:3;
- } gflags;
-
- }
-
- - initFromFile:(const char *) file;
- - initFromStream:(NXStream *) stream;
-
- - (BOOL) listUnavailableResources:(ResourceList *) resourceList;
- - addResources:(Resource *) resourceDoc for:(NXRect *) r;
-
- - free;
- - freeTemp;
- - copyTemp;
-
- - setFilename:(const char *) file;
- - setImage:anImage;
- - setImageRep:anImageRep;
-
- - setSelected:(BOOL) flag;
- - (BOOL) selected;
- - setImageable:(BOOL) flag;
- - (BOOL) imageable;
- - (BOOL) error;
-
- - setPoint:(int) pt_num :(const NXPoint *) pt;
- - setSize:(const NXSize *) aSize;
- - setOrigin:(const NXPoint *) pt;
- - setBounds:(const NXRect *) aRect;
-
- - setOriginalSize;
- - setOriginalRatio;
-
- - rotateAboutPoint:(NXPoint *) aPoint withAngle:(float) angle;
- - moveAll:(const NXPoint *) pt;
-
- - getPoint:(int) pt_num :(NXPoint *) pt;
- - getBounds:(NXRect *)aRect;
- - getScrollRect:(NXRect *)aRect forPtNum:(int) pt_num;
-
- - constrainAngle:(float *)angle withFlags:(int) flags;
- - constrainPoint:(NXPoint *)aPt forPtNum:(int *) pt_num
- inRect:(const NXRect *) viewRect withFlags:(int) flags;
-
- - hitControl:(const NXRect *) hitRect :(int *) pt_num forSize:(float) size;
- - hitObject:(UPath *) hitUpath ifNotSelected:(BOOL) flag;
-
- - putControlPoints:(UPath *)buffer forRect:(NXRect *)r :(NXPoint *) lastPoint;
-
- - drawBoxforRect:(NXRect *) r imaging:(BOOL) imageFlag;
- - drawObject:(NXRect *) r withFlags:(int) flags inView:view;
-
- - write:(NXTypedStream *)stream;
- - read:(NXTypedStream *)stream;
- - awake;
-
- - displayError;
-
- @end
-
-